<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../vue/vue.js" charset="utf-8"></script>

</head>
<body>

<div id="app">
    <span v-red>asdasd</span>
</div>

<script>
    //自定义指令
    Vue.directive('red',{bind:function(el){
        el.style.background='red'
    }
    })
    new Vue({
        el:'#app',
        data:{
            msg:"asdasd",
        }
    })
</script>

</body>
</html>